<template>
	<view>
		<cu-custom bgColor="bg-gradual-red" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">个人信息</block>
		</cu-custom>

		<view class="cu-form-group margin-top">
			<view class="title">用户名</view>
			<input v-model="userinfo.username" name="input"></input>
		</view>
		<view class="cu-form-group">
			<view class="title">姓名</view>
			<input v-model="userinfo.realname" name="input"></input>
		</view>
		<view class="cu-form-group">
			<view class="title">邮箱</view>
			<input  v-model="userinfo.email" name="input"></input>
		</view>
		<view class="cu-form-group">
			<view class="title">性别</view>
			<input  v-model="userinfo.gender"   name="input"></input>
			<text class='cuIcon-locationfill text-orange'></text>
		</view>
		<view class="cu-form-group">
			<view class="title">验证码</view>
			<input placeholder="输入框带个按钮" name="input"></input>
			<button class='cu-btn bg-green shadow'>验证码</button>
		</view>
		<view class="cu-form-group">
			<view class="title">手机号码</view>
			<input v-model="userinfo.mobilePhone" name="input"></input>
			<view class="cu-capsule radius">
				<view class='cu-tag bg-blue '>
					+86
				</view>
				<view class="cu-tag line-blue">
					中国大陆
				</view>
			</view>
		</view>




	</view>
</template>

<script>
	export default {
		data() {
			return {
				userinfo: {}
			}
		},
		onLoad: function() {
			//判断一下是否登陆
			this.init()
		},
		methods: {
			init: function() {
				//重构代码
				//1 首先获得Id
				//2 网络请求			
				var id = this.$global.userinfo.id;
				console.log(id)
				this.$api.__api__customer_info(id).then((res)=>{
					//没有自己的this  
					this.userinfo =res.data;
				
				})
				
				
				
				
			}
		}
	}
</script>

<style>

</style>
